<html lang="en" xml:lang="en"><head>
<META http-equiv="Content-Type" content="text/html">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><META name="description" content="The Query widget allows you to build your own query for the app."><meta name="content-language" content="en"><link href="rsrc/htmlhelp.css" rel="stylesheet" type="text/css"><title>Web AppBuilder for ArcGIS | Help - 
Query widget
</title>
                <script type="text/javascript" language="JavaScript">
                    var pathL  = self.location.pathname.split ("/");
                    var fname = pathL[pathL.length-1];
                    var i = fname.lastIndexOf (".htm");
                    if (i>=0) {
                    fname = fname.substring (0, i)
                    } else {
                    //??
                    }
                    if (self.location.hash) {
				    		      fname = fname + self.location.hash;
						        }
                    self.location.replace ("../index.html#//" + fname);
                </script>
                </head><!--Publication GUID: [GUID-E7D1C130-8F87-4109-8D61-E73A46083F52]--><!--Topic GUID: [GUID-4D155BCB-9394-4991-9CE3-2B738924D5D4]--><body><div id="content"><div class="header"><h1>
Query widget
</h1><div id="breadcrumb"></div></div>
<p id="GUID-4DE4E990-0A50-4983-9FF3-61569082CA8C"> The Query widget allows you to retrieve information from source data by executing a predefined query. Data sources can be one of the following:</p><ul purpose="ul" id="UL_02E191F41DB145E8A6C15293B2CB98F8"><li purpose="li" id="LI_84C90CD963274775800A95B08414D913">Feature layer in the current map </li><li purpose="li" id="LI_8ECE25D624F146E5AAF6B2DD476135E7">Feature layer as an item in the portal</li><li purpose="li" id="LI_AC4261C17DF2453CA889C1DBCDC105BE">Feature layer  from an ArcGIS Server REST  service<div class="notes" id="GUID-7B2B8629-FF90-4B56-8F39-DE7D99DDAE93"><div class="tip"><img class="note_img" src="rsrc/tip.png" alt="Tip" title="Tip"><span>Tip:</span></div><div class="tipbody"><p id="GUID-6D50504D-B46B-4E7A-9DC3-AFFFFA91F7CA">A feature layer can be from a map service or a feature service:</p></div></div></li><li purpose="li" id="LI_F74E0A43CA6C40AA939498F21584A565">Imagery layer from an image service</li><li purpose="li" id="LI_8EFC62AF3DDA4135AC9EABA19C16853A">Table</li></ul> 

<p id="GUID-0EF193B8-29CC-4BF9-81FF-B604E96E7897"> The Query widget serves as a query builder during configuration,  allowing you to define the query by specifying source data, filters, and displaying fields in query results. Each query works with a single layer. However, you can define multiple queries for a single app and data layers can be from multiple sources.</p><div class="section1" id="GUID-5882587B-971C-446A-9D0A-8C5541CC8D70" purpose="section1"><h2>
Configuring the Query widget
</h2><p id="GUID-A907D833-E74F-4101-AD8A-D2B9F4BE6A29"> The Query  widget can be set to open automatically when an app starts. To do so, click the dot on the widget to turn it  dark green.</p><p id="GUID-95D208E5-0F56-4344-AFD8-9CB7C8583A83">The following steps indicate how to configure a query. Repeat these steps if you need to define multiple queries.</p></div>
 <div class="wfsteps" purpose="wfsteps"><h4></h4><div class="steps" id="GUID-28DA7D81-9EEC-40F6-BB08-B0C99B889E36"><div class="step_title">Steps:</div><ol>
<li purpose="step" id="GUID-C4B7C1A6-E449-446E-94DB-074B5BCD7091">
<span purpose="cmd" id="GUID-D2FDE6C7-822A-4FD1-BAF2-7128FB59F0F1">
Hover over the Query widget and click the small edit icon
<img purpose="img" placement="inline" alt="Edit" title="Edit" src="03w3/GUID-31D329BD-BC73-4BBE-AE1D-3A1261BF912A-web.png">.</span>
<div class="stepresult" purpose="stepresult"><p id="GUID-5BBC15C5-D5CB-4FC5-B849-53E856BC4642">The configuration window opens for this widget.</p></div></li>
<li purpose="step" id="ESRI_STEP_79E74585DA5E4AE2BC6D6276E5A73F0E"><span purpose="cmd" id="GUID-0BF93AA2-EA79-4B8E-BC7C-5AACD6C115CF">Optionally click <span class="uicontrol">change widget icon</span> if you want to replace the default icon for this widget.</span><div class="stepresult" purpose="stepresult"><p id="GUID-00ECBC9C-227E-417A-824E-AEC92A6216E6">A file explorer window opens, allowing you to browse to a  local image file to use as the widget icon.</p></div></li><li purpose="step" id="ESRI_STEP_70BB580BE1DA46D1A2018143B7C057CC"><span purpose="cmd" id="GUID-720E6BFA-56E6-4FD3-A050-F7151EEE9A5C">Click <span class="uicontrol">+ New Query</span>.</span><div class="stepresult" purpose="stepresult"><p id="GUID-195793D7-B1A5-40E0-8A1C-8BD3BBA196DD">The <span class="uicontrol">Set Data Source</span> window opens. By default, <span class="uicontrol">Select from Map</span> is chosen and all feature layers in the current map are listed below it. </p><p id="GUID-6F5AEB32-9D8B-4BEC-AF22-7AA54E76D80D">Alternatively, you can choose <span purpose="ph" ishcondition="agol_plat=wab_dev"> from your portal</span> or <span class="uicontrol">Add Service URL</span>. In addition to  layers, you can query against related tables. </p></div></li><div class="stepinfo" purpose="stepinfo"><div class="notes" id="GUID-EC377E81-2D2A-45A2-A544-732DEB106B98"><div class="caution"><img class="note_img" src="rsrc/caution.png" alt="Caution" title="Caution"><span>Caution:</span></div><div class="tipbody"><p id="GUID-BFFFB11B-DA8B-4234-AAD5-86518EB9BD87"><span purpose="ph" varid="wab">Web AppBuilder for ArcGIS</span>  integrated in <span purpose="ph" varid="ArcGISOnline">ArcGIS Online</span> supports ArcGIS Server authentication for adding and accessing secure services. For secure services with web-tier authentication, administrators must <a class="xref" target="_blank" rel="http://server.arcgis.com/en/portal/latest/administer/windows/configure-security.htm" href="http://server.arcgis.com/en/portal/latest/administer/windows/configure-security.htm">configure trusted servers</a> that allow <span purpose="ph" varid="ArcGISOnline">ArcGIS Online</span> to automatically pass through credentials. When  trusted servers are updated, you need to edit the app and save the updated information accordingly.   Refer to <span purpose="ph" varid="ArcGISOnline">ArcGIS Online</span> <a class="xref" target="_blank" rel="http://server.arcgis.com/en/portal/latest/use/arcgis-server-services.htm" href="http://server.arcgis.com/en/portal/latest/use/arcgis-server-services.htm">ArcGIS Sever web services</a> for more information.</p></div></div></div><li purpose="step" id="ESRI_STEP_4EAFD0D5E0A74E2DB4466DF150459C67"><span purpose="cmd" id="GUID-ED1CFA68-BE5D-436B-BD87-1CDB01538895">Choose the radio button next to a data source.</span></li><li purpose="step" id="ESRI_STEP_F988D60B0D754DE6A29DE8A1759F2FBA"><span purpose="cmd" id="GUID-26A585DC-24BD-4F75-B106-004F656A993C">Select a layer from the list.</span></li><li purpose="step" id="ESRI_STEP_3BAAE476512442D088E236D3A7E2AA54"><span purpose="cmd" id="GUID-D5B34A70-42C7-48FA-94F4-5DF554E01ED5">Click <span class="uicontrol">OK</span> to close the <span class="uicontrol">Set Data Source</span> window and return to the query configuration window.</span><div class="info" purpose="info"><p id="GUID-75469082-9034-42DC-8301-F3712DF34BCD">By default, the <span class="uicontrol">Info</span> tab is active.</p></div></li><li purpose="step" id="ESRI_STEP_19E13F02712C4EF1B1BC8E3CEBB78BD6"><span purpose="cmd" id="GUID-27C0C704-D1FA-44B3-A655-58B540CDB340">Specify the title and icon for the query task.</span></li><li purpose="step" id="ESRI_STEP_B843EA2B68F24A379C1549A65C381F97"><span purpose="cmd" id="GUID-FC1FEABD-351C-4A20-9F5A-E56BB82C2292">Click the <span class="uicontrol">Filters</span> tab.</span></li><li purpose="step" id="ESRI_STEP_3547D68876AA41E1A6068BF764FBC0A3"><span purpose="cmd" id="GUID-B3913422-F9C9-4FE0-8307-6066E2C542E7">Click <span class="uicontrol">Set</span> <img purpose="img" placement="inline" alt="Set" title="Set" src="03w3/GUID-25056F96-74EA-4BA5-BA25-906E970AE27E-web.png"> under <span class="uicontrol">Attribute criteria</span> to define a where clause for the query.</span><div class="substeps" id="ESRI_SUBSTEPS_ED9CEC1D89B840538ABC7E59A092896C" purpose="substeps"><ol><li purpose="substep" id="ESRI_SUBSTEP_A86C10520CC54936A9A9A0ADF3B36243"><span purpose="cmd" id="GUID-E0B33647-1D09-452D-95D6-C305F9F3BDAD">Click <span class="uicontrol">Add a filter expression</span> to display the expression builder.</span></li><li purpose="substep" id="ESRI_SUBSTEP_9456E5CE00784EB99EC8070EFD512258"><span purpose="cmd" id="GUID-3E065537-168A-4F1E-B4AB-566598F20E03">Select a query field—an expression—and provide a value in the text box. Optionally choose the <span class="uicontrol">Unique</span> option to list all unique values for the selected field in the  layer. This option is useful when your selected field is a string or number and you want to only show the values based on the previous expressions.</span><div class="info" purpose="info"><p id="GUID-796C0D24-E24E-484B-B97D-CD92774CC0FD">The filter expression can be a value-based operation or  an operation between two fields. Choosing the <span class="uicontrol">Unique</span> option lists the unique values for the selected field in the layer. By default, <span class="uicontrol">Value</span> is chosen.</p></div></li><li purpose="substep" id="ESRI_SUBSTEP_D907B484983E4361AA838E3DA994D102"><span purpose="cmd" id="GUID-A8F37A06-32EE-4F22-9C4E-3FEB866B1014">Optionally check  <span class="uicontrol">Ask for values</span> on  the <span class="uicontrol">Value</span> or <span class="uicontrol">Unique</span> option if you want to set up an interactive expression. Enter information about the value in the <span class="uicontrol">Prompt</span> field and a hint in the <span class="uicontrol">Hint</span> field. By default, unique values are shown based on the previous expressions. Uncheck <span class="uicontrol">Only show values filtered by previous expressions</span> if you want to show all the values.</span><div class="info" purpose="info">When this option is chosen, your input value is the default query value and you have the choice of providing a new value to  overwrite the default value at run time. </div></li><li purpose="substep" id="ESRI_SUBSTEP_B968EE462936424784BCE6A8A4B15D01"><span purpose="cmd" id="GUID-4751C28B-CDE4-4F72-A5AD-A67509BE83E1">You also have the option to use  <span class="uicontrol">Add an expression set</span>, which allows you to define and apply two filters to a single query. If  <span class="uicontrol">All</span>  or <span class="uicontrol">Any</span> of the expressions in this set are <span class="usertext">true</span>, records meeting all the expressions or records meeting any of the expressions in the set return as the results.</span></li><li purpose="substep" id="ESRI_SUBSTEP_A49559200A1E403F84A6DD24D2634610"><span purpose="cmd" id="GUID-1D15D9AA-BEEA-417F-AC70-931EA403568C">Click <span class="uicontrol">OK</span> to close the dialog box.</span></li></ol></div></li><li purpose="step" id="ESRI_STEP_6F0838C54F484841BEA9A84A0CC2E799"><span purpose="cmd" id="GUID-A614C3EF-4CF4-4106-8EF4-67C9DC28010F">Check <span class="uicontrol">Display SQL expression for end users</span> if you want to show the SQL expression on the widget. </span></li><li purpose="step" id="ESRI_STEP_66E600C125CF46B4B39E32A274500553"><span purpose="cmd" id="GUID-3AEB05BE-8E34-4A5B-B39B-0C79A5C58E44">The <span class="uicontrol">Spatial filters</span> section allows you to choose which spatial filters will be available to end users. Check one or more of the following filters and set one of them as default by clicking <span class="uicontrol">Make default</span>.</span><ul purpose="choices" id="ESRI_CHOICES_7FAF69B1B16248288176A5D084B8A2A8"><li purpose="choice" id="ESRI_CHOICE_910E665E72E34093BC9FA9BAD7FB738D"><span class="uicontrol">Only return features within current map extent</span>—Return features within current map extent.</li><li purpose="choice" id="ESRI_CHOICE_EFE4D3DB4B424CD5A9B0ADB5C2BFD8FC"><span class="uicontrol">Only return features that intersect with the shape drawn on the map</span>—Click the icons to choose drawing tools shown on the widget. Check  <span class="uicontrol">Enable buffer option</span> if you want to add a buffer setting for end users. </li><li purpose="choice" id="ESRI_CHOICE_9523C20FE6564181B9B02D82BF046AE8"><span class="uicontrol">Only return features that have a spatial relationship with features in another layer</span>—Click <span class="uicontrol">Set</span> <img purpose="img" placement="inline" alt="Set" title="Set" src="03w3/GUID-25056F96-74EA-4BA5-BA25-906E970AE27E-web.png"> to choose spatial relationship rules from <span class="uicontrol">Set Spatial Relationships</span>.  You can specify a user-friendly label for each relationship by double-clicking the label field. Check <span class="uicontrol">Enable buffer option</span> if you want to add a buffer setting for end users. The following spatial relationships are supported:<ul purpose="ul" id="UL_9E4D9AEDDC3847D99E861B31BE3671DD"><li purpose="li" id="LI_0C8CFE1018264CB095C4C6D1CCDEE2BA"><span class="uicontrol">Intersect</span>—Part of a feature from layer 1 is contained in a feature from layer 2.</li><li purpose="li" id="LI_8CB34E5522B144718319A4F1A1AC3FAA"><span class="uicontrol">Contain</span>—Part or all of a feature from layer 1 completely contains the feature from layer 2.</li><li purpose="li" id="LI_CF11317E8FC845BD9DD52B836599BDCF"><span class="uicontrol">Cross</span>—The feature from layer 1 crosses a feature from layer 2.</li><li purpose="li" id="LI_9ADBBFF23E3C4A849CD74F71F02CDADB"><span class="uicontrol">Envelope intersect</span>—The envelope of layer 1 intersects with the envelope of layer 2.</li><li purpose="li" id="LI_05E848B417894F31B8E136289DD0CDF8"><span class="uicontrol">Index intersect</span>—The envelope of the query layer intersects the index entry for the target layer.</li><li purpose="li" id="LI_E3DFB4BBB601445197C173BD9C1ED17B"><span class="uicontrol">Overlap</span>—Features from layer 1 overlap features in layer 2.</li><li purpose="li" id="LI_CDF8B2C012874D5080C84F3377AF7D42"><span class="uicontrol">Touch</span>—The feature from layer 1 touches the border of a feature from layer 2.</li><li purpose="li" id="LI_7DD6AD7412F94443BAC28BB2416E8AD9"><span class="uicontrol">Within</span>—The feature from layer 1 is completely enclosed by the feature from layer 2.</li></ul></li><li purpose="choice" id="ESRI_CHOICE_CF3F58E9DC364F16A486716451A897B0"><span class="uicontrol">Return features within full extent of the map</span>—</li></ul><div class="info" purpose="info"><div class="notes" id="GUID-A434A987-EDD2-4170-B3E7-C4E672305295"><div class="note"><img class="note_img" src="rsrc/note.png" alt="Note" title="Note"><span>Note:</span></div><div class="tipbody">Uncheck all the options  if you don't want to apply a spatial filter to the query.</div></div></div></li><li purpose="step" id="ESRI_STEP_FFB681AAEDB9428AA04CD26B137FB993"><span purpose="cmd" id="GUID-DEF59573-C9B1-4806-9329-C0444077088F">Click the <span class="uicontrol">Results</span> tab to configure the displayed content and symbol for the query results.</span></li><li purpose="step" id="ESRI_STEP_4D9BDD7C7C9A4013975BC0E9FBA8CFAA"><span purpose="cmd" id="GUID-65C19489-CD75-4490-AD6A-807A55561805">Check <span class="uicontrol">Use layer's pop-up configuration in the web map</span> if you want to show the same content defined by the layer’s pop-up configuration in the web map.</span></li><li purpose="step" id="ESRI_STEP_0D30BABBCEB14E20B95151FBF9703FC4"><span purpose="cmd" id="GUID-03475E47-4EBD-48B0-AD9E-AD2D88593947">Check <span class="uicontrol">Configure custom content</span> if you want to show the custom content.</span><div class="substeps" id="ESRI_SUBSTEPS_C9E0DE2773504AEE9B49A77893E7BBE6" purpose="substeps"><ol><li purpose="substep" id="ESRI_SUBSTEP_7C6B3EE5D34D499C978C55D31EF6916D"><span purpose="cmd" id="GUID-CAE510AF-15BD-4BD1-818B-C809032B2174">Click the <span class="uicontrol">Add</span> button next to the <span class="uicontrol">Title of each result item</span> text box.</span></li><li purpose="substep" id="ESRI_SUBSTEP_3F8BD134357A4B65971F65E13F533D06"><span purpose="cmd" id="GUID-5EA8761B-2F4F-4CD0-9F27-27BCF6A9755C">The list of fields in the layer displays and allows you to select one at a time. Values from the selected field display in the text box and are used as the query results title. Repeat this step to add additional fields. When multiple fields are added, the concatenation of field values are used as the result title. </span></li><li purpose="substep" id="ESRI_SUBSTEP_4FD005803BE34822BD8B04267D11F341"><span purpose="cmd" id="GUID-F11EFFBD-2EE3-4C64-A7B9-2979E07A5873">Click the pencil button next to <span class="uicontrol">These field attributes will display</span> text box to open the <span class="uicontrol">Set Display Fields</span> dialog box. Check the fields you want to display in the results. For individual fields, the <span class="uicontrol">Special Type</span> column allows them to display as a link or an image according to your selection. You can also click the up or down arrows in the <span class="uicontrol">Actions</span>  column to adjust the field order.</span></li></ol></div></li><li purpose="step" id="ESRI_STEP_DD875BB8A6DA4AC8AC5067ACEAF417B7"><span purpose="cmd" id="GUID-BDA317E9-81F4-4D47-A281-13C435BB4CB9">Click the pencil button next to the <span class="uicontrol">Sort result items</span> to configure the fields by which  the query result is sorted. </span><div class="info" purpose="info"><p id="GUID-D065B592-B4E9-44B5-8A81-12801B978425"> The services must support pagination or sort on the query result.</p></div></li><li purpose="step" id="ESRI_STEP_40A72CC3730444A1894FFBFB12B59DA4"><span purpose="cmd" id="GUID-9444F72C-1D6E-482D-B42B-F5749196C962">Check <span class="uicontrol">Use symbols defined by the layer</span> if you  want to use the layer’s default symbol.</span></li><li purpose="step" id="ESRI_STEP_596F5E2AC16849538637D7878D91F2D5"><span purpose="cmd" id="GUID-D4B01EED-5D11-426C-BAEF-138E603FC9A4">Click <span class="uicontrol">Set custom symbol</span> to set a custom symbol, check the box, and click  the symbol button.</span><div class="stepresult" purpose="stepresult"><p id="GUID-AC6017DE-4AD0-489B-BB0A-517514E1B177">The <span class="uicontrol">Preview</span> window opens, allowing you to choose the color and style for the resulting highlighting symbol.</p></div></li><li purpose="step" id="ESRI_STEP_2505E8182535486783FA2F81582AE337"><span purpose="cmd" id="GUID-89101BAE-917D-4780-A644-25ABF8E81BD5">Click anywhere outside of the symbol preview window to close it.</span></li><li purpose="step" id="ESRI_STEP_07B123FAF5CC4F99AE11563DF84A2073"><span purpose="cmd" id="GUID-324E6BAC-1324-46FF-A8EE-5371E29AEC91">Click the <span class="uicontrol">Options</span> tab  to specify if  the query results can be  exported and how the query task creates layers. </span></li><li purpose="step" id="ESRI_STEP_26F6BF67008B4B0C8F7E8B42A71E80EA"><span purpose="cmd" id="GUID-7B84F317-E92E-4CA8-8780-0689ADA1B4BD">Repeat steps 3 through 19 to add more query tasks.</span></li><li purpose="step" id="ESRI_STEP_2371442FF3314E61BDF7370B3F6093E8"><span purpose="cmd" id="GUID-C8FF743D-4E00-4063-9308-BF830E19BE28">To  reorder the existing query tasks, hover over the  task and click the up and  down arrow. </span></li><li purpose="step" id="ESRI_STEP_E13F8BCECFAD4F26A05B8AD78311931C"><span purpose="cmd" id="GUID-E03CCE52-B75A-4236-8E00-30F1226B2F32">Click <span class="uicontrol">OK</span> to save and close the <span class="uicontrol">Query</span> window.</span></li></ol></div></div>
<div class="section1" id="ESRI_SECTION1_93B7EEDFDDDB4389B1F994E7792FF6DA" purpose="section1"><h2>Using the Query widget</h2></div><div class="wfsteps" purpose="wfsteps"><h4></h4><div class="steps" id="ESRI_STEPS_E1CDDCE745A64F21889D82112D83FCAB"><div class="step_title">Steps:</div><ol><li purpose="step" id="ESRI_STEP_C3D00527829144DCA1C89C9681AAE0B7"><span purpose="cmd" id="GUID-BB3287A5-48A9-4395-B713-93F5FEBD42CE">Click the Query widget to open it. A list of queries are shown under the <span class="uicontrol">Tasks</span> tab if you have configured more than one query. <div class="image" purpose="image"><table><tr><td><img class="break" src="03w3/GUID-7A580664-2440-4B97-B29D-C6F28C08075E-web.png" purpose="img" alt="List of queries" title="List of queries"></td></tr></table></div></span><div class="info" purpose="info"><p id="GUID-CED5A595-512B-48E3-8DEE-BABBC688B884"> If the widget only has one query, and it does not ask for input from end users, clicking the widget  will run the query and immediately display the results.</p><p id="GUID-188E9EFF-BEA9-488D-9779-EC7109FEB0D6">if the widget only has one query, and it asks for input from end users, clicking the widget will display the  query with user inputs.</p><div class="notes" id="GUID-2C43895A-497E-4E85-8137-1E3B9B70079E"><div class="note"><img class="note_img" src="rsrc/note.png" alt="Note" title="Note"><span>Note:</span></div><div class="tipbody"><p id="GUID-0F8A4113-DD5B-4CB6-A282-EDD755F978D4"> The input from end users may include an attribute criteria, one or many spatial filters, or a combination of both.</p></div></div></div></li><li purpose="step" id="ESRI_STEP_5746E85043DD4EC1AD5A9F082387D9FB"><span purpose="cmd" id="GUID-F988814A-6123-4DEA-B7E1-9ADB9B25DB67">Click one of the queries. The query may execute differently depending on your configuration. </span><div class="substeps" id="ESRI_SUBSTEPS_1D732E6227FC424A9EE522A7E18449F9" purpose="substeps"><ol><li purpose="substep" id="ESRI_SUBSTEP_C04B2871BDC648ED92F8050EDDBD2DA0"><span purpose="cmd" id="GUID-68F15662-8873-486F-A796-FB2CEDF6CA15">If the query does not ask for input, the result shows under the <span class="uicontrol">Results</span> tab and the resulting features display on the map with  the symbol you specified during the configuration. </span></li><li purpose="substep" id="ESRI_SUBSTEP_AD051F9D935D4C24BFBBFDD44A38E617"><span purpose="cmd" id="GUID-CB045A35-F619-4E58-8103-B7F754DCE8A7">If <span class="uicontrol">Ask for values</span> is checked in the configuration, a text box displays prompting you for a new value for the parameter.   The default value initially shows in the box.  If unique values are set, the text box will list them all.</span></li><li purpose="substep" id="ESRI_SUBSTEP_F4E18A5E2E464643B29B1CDDF4424C9C"><span purpose="cmd" id="GUID-98F83050-CC4B-4CBF-B469-472B17C90C25">You may use one or more spatial filters.</span><div class="info" purpose="info"><ul purpose="ul" id="UL_B40FB3E767A24CEFBEF6D008A29B6A88"><li purpose="li" id="LI_3B96AEC07B5C4C929368846B6960329C"><span class="uicontrol">Only return features within current map extent</span>—Return features within current map extent.</li><li purpose="li" id="LI_C8275273DD7C4E55AD6EFF805E5FB040"><span class="uicontrol">Only return features that intersect with the shape drawn on the map</span>—A set of drawing tools can be used to draw shapes on the map to define the area. Optionally, a search distance can be applied to the shapes. <div class="image" purpose="image"><table><tr><td><img class="break" src="03w3/GUID-2D74B8E9-EDEF-4E22-ABC1-5DD9BB258BEA-web.png" purpose="img" alt="Draw on the map" title="Draw on the map"></td></tr></table></div></li><li purpose="li" id="LI_AD758D2DDE6C439DB5290C0700DBCACA"><span class="uicontrol"> Only return features that have a spatial relationship with features in another layer</span>—The  results are based on the spatial relationship between features in  the query layer and the related layer. Optionally, a search distance can be applied to the geometries of the features in the related layer.<div class="image" purpose="image"><table><tr><td><img class="break" src="03w3/GUID-B72C7427-344B-4D24-A806-50BBCFD50008-web.png" purpose="img" alt="Has spatial relationship with features in another layer" title="Has spatial relationship with features in another layer"></td></tr></table></div></li><li purpose="li" id="LI_3715099248D947A196C3DF8C283C573B"><span class="uicontrol">Return features within full extent of the map</span>—Return features within full extent of the map.</li></ul></div></li><li purpose="substep" id="ESRI_SUBSTEP_BD2C439F009D451B804ECA97B177DD0B"><span purpose="cmd" id="GUID-AC07B9B1-4985-4F0B-B3CD-A5FFF9DB155F">Click <span class="uicontrol">Execute</span> to run the query. If the layer has related data, the related records are also included in the results. Features resulting from the query are highlighted on the map with the symbol you specified during the configuration.</span></li></ol></div></li><li purpose="step" id="ESRI_STEP_BB4FAED1A2854DCC9E04AEC8A1D37E5B"><span purpose="cmd" id="GUID-70B5E255-DD75-4545-8064-906A393E4E00"> You can take actions on the results set, such as  doing statistics and  exporting the results.<div class="image" purpose="image"><table><tr><td><img class="break" src="03w3/GUID-16136C00-C18D-4B5C-95DF-EAB3C10C8109-web.png" purpose="img" alt="Actions" title="Actions"></td></tr></table></div></span><div class="info" purpose="info"><div class="notes" id="GUID-2F692BCC-8D3F-4944-9185-064CDAD18913"><div class="tip"><img class="note_img" src="rsrc/tip.png" alt="Tip" title="Tip"><span>Tip:</span></div><div class="tipbody"><p id="GUID-811EE4E1-247F-43BC-8A34-07929BE78849">The maximum features  a query can return  depends on    the <span class="usertext">maxRecordCount</span> property set in  the service. By default, it is 1,000. For example,     if you  take the default value and expect 1,300 features  to  return from a query, you  will first see 1,000 features in the query result panel. When you scroll down the panel, you will see the remaining  300 features.</p></div></div><p id="GUID-ECC8CBAE-1CBF-4BC1-8E9E-2BDF6757A64F">Alternatively, if the query is performed on a related table, the related features will display in the result.</p></div></li></ol></div></div><div class="footer"> Copyright © 1995-2016 Esri. All rights reserved. </div></div></body></html>